#include<stdio.h>
#include<stdlib.h>
#include<time.h>
void menu()
		{
			printf("******************\n");
			printf("*******1.play****\n");
			printf("*******0.exit*****\n");
			printf("******************\n");
		}
void game()
			{
				int ret=rand()%100+1;
				int guess=0;
				while(1)
				{
                 printf("请输入您要猜测的数字：\n");
				scanf("%d",&guess);
				if(ret>guess)
				{
					printf("猜测过小，请重新猜测\n");
				}
				else if(ret<guess)
				{
					printf("猜测过大，请重新猜测\n");
				}
				else
				{
					printf("恭喜您猜对了，要猜测的数字是：%d\n",ret);
					break;
				}
				}


			}
int main()
	{
		srand((unsigned int)time(NULL));
		int input=0;
		do
		{
			menu();
		printf("请选择您要进行游戏还是退出游戏（选1进行游戏，选0退出游戏）：\n");
		scanf("%d",&input);
		switch(input)
		{
			case 1:
				game();
				break;
			case 0:
				printf("游戏结束退出游戏！\n");
				break;
	}
		}while(input);
			return 0;
	}





































































































